<style type="text/css">
		<!--
		A:link        {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
		A:visited     {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
		A:hover       {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: underline; color: #FF0000}
		th            {font-family: helvetica, arial; color : blue; font-size:85%; background : lightgrey; border-right:black solid 1pt; border-bottom:black solid 1pt;}
		//-->
		</style><hr><a name="_C_BEZIER"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>Bezier</b></div>
<i>(Defined in: jpgraph_regstat.php : 113)</i><table border=1><tr><td>&nbsp;<a href="Bezier.html" style="font-family:arial;font-weight:bold;color:darkblue;">Bezier</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="Bezier.html#_BEZIER_BEZIER">Bezier()</a>&nbsp;<br>
&nbsp;<a href="Bezier.html#_BEZIER_GET">Get()</a>&nbsp;<br>
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>Utility class to help construct an interpolated data points given an arbitrary number of data points.
<p>
This class doesn't draw any graphs by itself it is only used to generate a new set of data points representing the smooth line from the input which are the control lines for a bezier interpolated curve.
<p>
The principle of using this class is that you first create an instance of this class and giving it the X,Y values for your control points.
<p>
You can then get back an interpolated smooth dataset by calling the Get() method. This method takeas as argument how many data points you want the interpolated graph to have.
<p>
In order to use this method the file jpgraph_regstat.php must be included.
<p>
Technical note: The control points for a bezier curve does not necessary lie on the curve. Using the alternative method of spline interpolation guarantees that the specified control point lie on the generated curve.
<p>
Technical note 2: An alternmative Bezier curve is also availabe in the Canvas tools (jpgraph_canvtools.php). The difference is that that method will not return any data points it will directly draw an interpolate bezier curve on the canvas.
 <p> &nbsp;
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="Spline.html">Spline</a> and <a href="Shape.html">Shape</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BEZIER_BEZIER"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
<font color="#0000BB"></font><font color="#007700">function&nbsp;</font><font color="#0000BB">Bezier</font><font color="#007700">(</font><font color="#0000BB">$datax</font><font color="#007700">,</font><font color="#0000BB">$datay</font><font color="#007700">,</font><font color="#0000BB">$attraction_factor</font><font color="#007700">)</font><font color="#0000BB"></font>
</font>
</b></div></a></span>

<span style='font-family:arial;font-size:90%;'><i>Create a new bezier object</i></span><p>

<table cellspacing=0 style='border:black solid 1pt;' width=100%>
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
<font color="#0000BB">$datax</font>
</font>

</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X-coordinates for control points</td></tr>

<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
<font color="#0000BB">$datay</font>
</font>

</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Y-coordinates for control points</td></tr>

<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
<font color="#0000BB">$attraction_factor</font>
</font>

</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Attraction factor</td></tr>
</table>

<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Creates a new Bezier interpoaltion object. The arguments specifies the X, and Y coordinate sof the control points to be used. 

The attraction factor is an integer >1 and determines how much "gracity" each control point should have. A higher value makes the resulting curve bend much more sharper against the control points. The default value is 1.&nbsp;<br>
<br>
<div style="font-weight:bold;font-family:arial;font-size:85%;">Returns</div>An instance of the bezier interpolation object<br>

<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
<font color="#0000BB"></font><font color="#FF8000">//&nbsp;Control&nbsp;points<br /></font><font color="#0000BB">$xdata&nbsp;</font><font color="#007700">=&nbsp;array(</font><font color="#0000BB">1</font><font color="#007700">,</font><font color="#0000BB">3</font><font color="#007700">,</font><font color="#0000BB">12</font><font color="#007700">,</font><font color="#0000BB">15</font><font color="#007700">);<br /></font><font color="#0000BB">$ydata&nbsp;</font><font color="#007700">=&nbsp;array(</font><font color="#0000BB">5</font><font color="#007700">,</font><font color="#0000BB">15</font><font color="#007700">,</font><font color="#0000BB">2</font><font color="#007700">,</font><font color="#0000BB">19</font><font color="#007700">);<br /><br /></font><font color="#FF8000">//&nbsp;Get&nbsp;the&nbsp;interpolated&nbsp;values&nbsp;by&nbsp;creating<br />//&nbsp;a&nbsp;new&nbsp;bezier&nbsp;object.<br /></font><font color="#0000BB">$bez&nbsp;</font><font color="#007700">=&nbsp;new&nbsp;</font><font color="#0000BB">Bezier</font><font color="#007700">(</font><font color="#0000BB">$xdata</font><font color="#007700">,</font><font color="#0000BB">$ydata</font><font color="#007700">);<br /><br /></font><font color="#FF8000">//&nbsp;For&nbsp;the&nbsp;new&nbsp;data&nbsp;set&nbsp;we&nbsp;want&nbsp;50&nbsp;points&nbsp;to<br />//&nbsp;get&nbsp;a&nbsp;smooth&nbsp;curve.<br /></font><font color="#007700">list(</font><font color="#0000BB">$newx</font><font color="#007700">,</font><font color="#0000BB">$newy</font><font color="#007700">)&nbsp;=&nbsp;</font><font color="#0000BB">$bez</font><font color="#007700">-&gt;</font><font color="#0000BB">Get</font><font color="#007700">(</font><font color="#0000BB">50</font><font color="#007700">);</font><font color="#0000BB"></font>
</font>
</span><br>
<p>
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BEZIER_GET"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
<font color="#0000BB"></font><font color="#007700">function&nbsp;</font><font color="#0000BB">Get</font><font color="#007700">(</font><font color="#0000BB">$steps</font><font color="#007700">)</font><font color="#0000BB"></font>
</font>
</b></div></a></span>

<span style='font-family:arial;font-size:90%;'><i>Return two arrays of X and Y coordinates that represents the curve</i></span><p>

<table cellspacing=0 style='border:black solid 1pt;' width=100%>
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
<font color="#0000BB">$steps</font>
</font>

</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Number of data points</td></tr>
</table>

<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Return a data set representing the interpolated smooth curve passing through all the specified control points.&nbsp;<br>
<br>
<div style="font-weight:bold;font-family:arial;font-size:85%;">Returns</div>array($datax,$datay)<br>

<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
<font color="#0000BB"></font><font color="#FF8000">//&nbsp;Control&nbsp;points&nbsp;for&nbsp;bezier&nbsp;curve<br /></font><font color="#0000BB">$xdata&nbsp;</font><font color="#007700">=&nbsp;array(</font><font color="#0000BB">1</font><font color="#007700">,</font><font color="#0000BB">3</font><font color="#007700">,</font><font color="#0000BB">12</font><font color="#007700">,</font><font color="#0000BB">15</font><font color="#007700">);<br /></font><font color="#0000BB">$ydata&nbsp;</font><font color="#007700">=&nbsp;array(</font><font color="#0000BB">5</font><font color="#007700">,</font><font color="#0000BB">15</font><font color="#007700">,</font><font color="#0000BB">2</font><font color="#007700">,</font><font color="#0000BB">19</font><font color="#007700">);<br /><br /></font><font color="#FF8000">//&nbsp;Get&nbsp;the&nbsp;interpolated&nbsp;values&nbsp;by&nbsp;creating<br />//&nbsp;a&nbsp;new&nbsp;Spline&nbsp;object.<br /></font><font color="#0000BB">$bez&nbsp;</font><font color="#007700">=&nbsp;new&nbsp;</font><font color="#0000BB">Bezier</font><font color="#007700">(</font><font color="#0000BB">$xdata</font><font color="#007700">,</font><font color="#0000BB">$ydata</font><font color="#007700">);<br /><br /></font><font color="#FF8000">//&nbsp;For&nbsp;the&nbsp;new&nbsp;data&nbsp;set&nbsp;we&nbsp;want&nbsp;50&nbsp;points&nbsp;to<br />//&nbsp;get&nbsp;a&nbsp;smooth&nbsp;curve.<br /></font><font color="#007700">list(</font><font color="#0000BB">$newx</font><font color="#007700">,</font><font color="#0000BB">$newy</font><font color="#007700">)&nbsp;=&nbsp;</font><font color="#0000BB">$bez</font><font color="#007700">-&gt;</font><font color="#0000BB">Get</font><font color="#007700">(</font><font color="#0000BB">50</font><font color="#007700">);<br /></font><font color="#0000BB"></font>
</font>
</span><br>
<p> <hr> <p>